<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta name="author" content="yinq">
<title>首页 - 后台管理系统模板</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<link rel="stylesheet" type="text/css" href="css/materialdesignicons.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/animate.min.css">
<link rel="stylesheet" type="text/css" href="css/style.min.css">
</head>

<body>
<!--页面loading-->
<div id="lyear-preloader" class="loading">
  <div class="ctn-preloader">
    <div class="round_spinner">
      <div class="spinner"></div>
      <img src="images/loading-logo.png" alt="">
    </div>
  </div>
</div>
<!--页面loading end-->
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
    <aside class="lyear-layout-sidebar">

      <!-- logo -->
      <div id="logo" class="sidebar-header">
        <a href="index.html"><img src="images/logo-sidebar.png" title="LightYear" alt="LightYear" /></a>
      </div>
      <div class="lyear-layout-sidebar-info lyear-scroll">

        <nav class="sidebar-main">

          <ul class="nav-drawer">
            <li class="nav-item active">
              <a href="javascript:void(0)" data-url="agent-management.html" class="load-page">
                <i class="mdi mdi-home-city-outline"></i>
                <span>首页</span>
              </a>
            </li>
            <li class="nav-item">
              <a href="javascript:void(0)" data-url="chat_history.html" class="load-page">
                <i class="mdi mdi-television-guide"></i>
                <span>聊天历史</span>
              </a>
            </li>

            <li class="nav-item nav-item-has-subnav">
              <a href="javascript:void(0)">
                <i class="mdi mdi-silo"></i>
                <span>备用</span>
              </a>
              <ul class="nav nav-subnav">
                <li> <a href="javascript:void(0)">排版</a> </li>
              </ul>
            </li>
            <li class="nav-item nav-item-has-subnav">
              <a href="javascript:void(0)">
                <i class="mdi mdi-map-outline"></i>
                <span>备用</span>
              </a>
              <ul class="nav nav-subnav">
                <li> <a href="javascript:void(0)">概述</a> </li>
              </ul>
            </li>
            <li class="nav-item nav-item-has-subnav">
              <a href="javascript:void(0)">
                <i class="mdi mdi-tune"></i>
                <span>备用</span>
              </a>
              <ul class="nav nav-subnav">
                <li> <a href="javascript:void(0)">手风琴菜单</a> </li>
                <li> <a href="javascript:void(0)">警告框</a> </li>
              </ul>
            </li>
          </ul>
        </nav>

        <div class="sidebar-footer">
          <p class="copyright">
            <span>Copyright &copy; 2025. </span>
            <a target="_blank" href="http://www.lumakeji.com">聆语AI</a>
            <span> All rights reserved.</span>
          </p>
        </div>
      </div>

    </aside>
    <!--End 左侧导航-->

    <!--头部信息-->
    <header class="lyear-layout-header">

      <nav class="navbar">

        <div class="navbar-left">
          <div class="lyear-aside-toggler">
            <span class="lyear-toggler-bar"></span>
            <span class="lyear-toggler-bar"></span>
            <span class="lyear-toggler-bar"></span>
          </div>
        </div>

        <ul class="navbar-right d-flex align-items-center">
          <!--顶部消息部分-->
          <li class="dropdown dropdown-notice">
            <span data-bs-toggle="dropdown" class="position-relative icon-item">
              <i class="mdi mdi-bell-outline fs-5"></i>
              <span class="position-absolute translate-middle badge bg-danger">7</span>
            </span>
            <div class="dropdown-menu dropdown-menu-end">
              <div class="lyear-notifications">

                <div class="lyear-notifications-title d-flex justify-content-between" data-stopPropagation="true">
                  <span>你有 10 条未读消息</span>
                  <a href="#!">查看全部</a>
                </div>
                <div class="lyear-notifications-info lyear-scroll">
                  <a href="#!" class="dropdown-item"
                    title="树莓派销量猛增，疫情期间居家工作学习、医疗领域都需要它">树莓派销量猛增，疫情期间居家工作学习、医疗领域都需要它</a>
                  <a href="#!" class="dropdown-item"
                    title="GNOME 用户体验团队将为 GNOME Shell 提供更多改进">GNOME 用户体验团队将为 GNOME Shell
                    提供更多改进</a>
                </div>

              </div>
            </div>
          </li>
          <!--End 切换主题配色-->
          <!--个人头像内容-->
          <li class="dropdown">
            <a href="javascript:void(0)" data-bs-toggle="dropdown" class="dropdown-toggle">
              <img class="avatar-md rounded-circle" src="images/users/avatar.jpg" alt="笔下光年" />
              <span class="user-nick" style="margin-left: 10px;">hcxu</span>
            </a>
            <ul class="dropdown-menu dropdown-menu-end">
              <li>
                <a class="dropdown-item" href="javascript:void(0)">
                  <i class="mdi mdi-account"></i>
                  <span>个人信息</span>
                </a>
              </li>
              <li>
                <a class="dropdown-item" href="javascript:void(0)">
                  <i class="mdi mdi-lock-outline"></i>
                  <span>修改密码</span>
                </a>
              </li>
              <li class="dropdown-divider"></li>
              <li>
                <a id="logOut" class="dropdown-item" href="javascript:void(0)">
                  <i class="mdi mdi-logout-variant"></i>
                  <span>退出登录</span>
                </a>
              </li>
            </ul>
          </li>
          <!--End 个人头像内容-->
        </ul>

      </nav>

    </header>
    <!--End 头部信息-->

    <!--页面主要内容-->
    <main id="hcxu" class="lyear-layout-content">

      <div class="container-fluid">

        <div class="row">



        <div class="row">

          <div class="col-lg-12">
          </div>

        </div>

      </div>

    </main>
    <!--End 页面主要内容-->
  </div>
</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/popper.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/jquery.cookie.min.js"></script>
<!--引入chart插件js-->
<script type="text/javascript" src="js/chart.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>
<script type="text/javascript" src="common/common.js"></script>
<!-- 引入 Toastr 的 CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet"/>
<!-- 引入 Toastr 的 JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>

<script>
  $(document).ready(function () {
    //设置用户信息
    const username = localStorage.getItem("username");
    $(".user-nick").text(username);
    //默认显示页面
    const defaultPageUrl = $('.nav-item:first .load-page').data('url');
    $('#hcxu').load(defaultPageUrl); // 加载默认页面
    $('.nav-item:first').addClass('active'); // 设置默认菜单项为active

    $('.load-page').on('click', function (e) {
      e.preventDefault();
      const pageUrl = $(this).data('url');
      $('.nav-item').removeClass('active'); // 去除旧的active
      $(this).closest('.nav-item').addClass('active'); // 添加当前active
      $('#hcxu').load(pageUrl); // 加载页面到内容区
    });

    

    $('#logOut').on('click', function (e) {
      //退出登录
      ajaxPost(
          "login/logOut",
          null,
          "POST",
          function (response) {
            if (response.code == 200) {
              toastr.success("已退出登录");
              window.location.href = 'login.html';
              localStorage.clear();
            } else {
              toastr.error(response.msg);
            }
          }
        );
    });
    
  });

</script>

</body>
</html>
